package com.znsd.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;

/**
 * <p>
 * 购物车表 用户登录系统时更新冗余
 * </p>
 *
 * @author Liuyl
 * @since 2019-10-16
 */
@TableName("cart_info")
public class CartInfo extends Model<CartInfo> {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * skuid
     */
    @TableField("sku_id")
    private Long skuId;
    /**
     * 放入购物车时价格
     */
    @TableField("cart_price")
    private BigDecimal cartPrice;
    /**
     * 数量
     */
    private Integer quantity;
    /**
     * 图片文件名称
     */
    @TableField("img_url")
    private String imgUrl;
    /**
     * 是否选中
     */
    @TableField("is_checked")
    private String isChecked;
    /**
     * sku单价（冗余需要同步)
     */
    @TableField("sku_price")
    private BigDecimal skuPrice;
    @TableField("sku_num")
    private BigDecimal skuNum;
    /**
     * sku名称 (冗余)
     */
    @TableField("sku_name")
    private String skuName;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public BigDecimal getCartPrice() {
        return cartPrice;
    }

    public void setCartPrice(BigDecimal cartPrice) {
        this.cartPrice = cartPrice;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getIsChecked() {
        return isChecked;
    }

    public void setIsChecked(String isChecked) {
        this.isChecked = isChecked;
    }

    public BigDecimal getSkuPrice() {
        return skuPrice;
    }

    public void setSkuPrice(BigDecimal skuPrice) {
        this.skuPrice = skuPrice;
    }

    public BigDecimal getSkuNum() {
        return skuNum;
    }

    public void setSkuNum(BigDecimal skuNum) {
        this.skuNum = skuNum;
    }

    public String getSkuName() {
        return skuName;
    }

    public void setSkuName(String skuName) {
        this.skuName = skuName;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "CartInfo{" +
        "id=" + id +
        ", userId=" + userId +
        ", skuId=" + skuId +
        ", cartPrice=" + cartPrice +
        ", quantity=" + quantity +
        ", imgUrl=" + imgUrl +
        ", isChecked=" + isChecked +
        ", skuPrice=" + skuPrice +
        ", skuNum=" + skuNum +
        ", skuName=" + skuName +
        "}";
    }
}
